extends Bullet
class_name CarBullet

var passenger:Node2D
var to_passenger_node:Node

func _recycle_self():
	make_passenger_get_off()
	super._recycle_self()

func get_in_car(passenger_:Node2D,to_passenger_node_:Node2D):
	passenger = passenger_
	to_passenger_node = to_passenger_node_

func make_passenger_get_off():
	if passenger in get_children():
		passenger.call_deferred("reparent",to_passenger_node)
		passenger.set_deferred("global_position",position)
